/******************************************************************************
 *                  Shanghai ChipON Micro-Electronic Co.,Ltd
 ******************************************************************************
 *  @File Name        : kf8a100fxx_gpio.h
 *  @Author           : ChipON AE/FAE Group
 *  @Date             : 2023-12-19
 *  @HW Version       : KF8A100Fxx
 *  @Lib Version      : V2.0.1
 *  @Description      : This file provides the driver for the gpio module
 ******************************************************************************
 *  Copyright (C) by Shanghai ChipON Micro-Electronic Co.,Ltd
 *  All rights reserved.
 *
 *  This software is copyright protected and proprietary to
 *  Shanghai ChipON Micro-Electronic Co.,Ltd.
 *****************************************************************************/
/******************************************************************************
 *  |Date        |Version  |Author       |Description
 ******************************************************************************
 *  |2023-12-25  |V2.0     |Zhong Yusheng|New creat
 *****************************************************************************/

#ifndef KF8A100FXX_GPIO_H
#define KF8A100FXX_GPIO_H

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
 *                      Include Files
 *****************************************************************************/
#include "kf8a100fxx.h"
/******************************************************************************
 *                      Macro or Inline
 *****************************************************************************/

/*****************************************************************************
 *                      Typedef Definitions
 *****************************************************************************/
typedef uint8_t Gpio_Status;

/**
 * @brief  GPIO port direction type
 *
 */
typedef enum
{
    GPIO_OUTPUT = 0u,
    GPIO_INPUT  = 1u,
} Gpio_PinDirType;

/**
 * @brief  GPIO port analog/digital type
 *
 */
typedef enum
{
    GPIO_DIGITAL = 0u,
    GPIO_ANALOG  = 1u,
} Gpio_PinAnsType;

/**
 * @brief  GPIO port level type
 *
 */
typedef enum
{
    GPIO_LOW_LEVEL  = 0u,
    GPIO_HIGH_LEVEL = 1u,
} Gpio_PinLevType;

/**
 * @brief  GPIO port pull-up type
 *
 */
typedef enum
{
    GPIO_PUR_DIS = 0u,
    GPIO_PUR_EN  = 1u,
} Gpio_PinPurType;

/**
 * @brief  GPIO port Interruption of pin level fluctuation type
 *
 */
typedef enum
{
    GPIO_IOC_DIS = 0u,
    GPIO_IOC_EN  = 1u,
} Gpio_PinIocType;

/**
 * @brief  GPIO ports pull-up total enable type
 *
 */
typedef enum
{
    GPIO_PUPH_EN  = 0u,
    GPIO_PUPH_DIS = 1u,
} Gpio_PinPuphType;

/**
 * @brief  GPIO port mask
 *
 */
typedef enum
{
    GPIO_PIN_MASK_0   = 0x01u,
    GPIO_PIN_MASK_1   = 0x02u,
    GPIO_PIN_MASK_2   = 0x04u,
    GPIO_PIN_MASK_3   = 0x08u,
    GPIO_PIN_MASK_4   = 0x10u,
    GPIO_PIN_MASK_5   = 0x20u,
    GPIO_PIN_MASK_6   = 0x40u,
    GPIO_PIN_MASK_7   = 0x80u,
    GPIO_PIN_MASK_ALL = 0xFFu
} Gpio_PinMaskType;

/**
 * @brief Vref input pin selection bit
 *
 */
typedef enum
{
    GPIO_VREF_P00 = 0x00u,
    GPIO_VREF_P03 = 0x10u,
    GPIO_VREF_P43 = 0x20u,
} Gpio_VrefType;

/**
 * @brief P18 outpin selection bit
 *
 */
typedef enum
{
    GPIO_P18OE_NULL = 0x00u,
    GPIO_P18OE_P04  = 0x04u,
    GPIO_P18OE_P27  = 0x08u,
    GPIO_P18OE_ALL  = 0x0Cu
} Gpio_P18oeType;

/**
 * @brief Clk outpin selection bit
 *
 */
typedef enum
{
    GPIO_CLKOUT_P04 = 0x00u,
    GPIO_CLKOUT_P05 = 0x01u,
    GPIO_CLKOUT_P45 = 0x02u
} Gpio_ClkOutType;

/**
 * @brief Ccp3 function pin selection bit
 *
 */
typedef enum
{
    GPIO_CCP3_P04 = 0x00u,
    GPIO_CCP3_P12 = 0x20u,
    GPIO_CCP3_P32 = 0x40u,
    GPIO_CCP3_P34 = 0x60u,
    GPIO_CCP3_P37 = 0x80u,
    GPIO_CCP3_P40 = 0x90u,
    GPIO_CCP3_P42 = 0xC0u,
    GPIO_CCP3_P43 = 0xE0u,
} Gpio_Ccp3Type;

/**
 * @brief Ccp4 function pin selection bit
 *
 */
typedef enum
{
    GPIO_CCP4_P04 = 0x00u,
    GPIO_CCP4_P12 = 0x04u,
    GPIO_CCP4_P32 = 0x08u,
    GPIO_CCP4_P34 = 0x0Cu,
    GPIO_CCP4_P37 = 0x10u,
    GPIO_CCP4_P40 = 0x14u,
    GPIO_CCP4_P42 = 0x18u,
    GPIO_CCP4_P43 = 0x1Cu,
} Gpio_Ccp4Type;

/**
 * @brief P5D function pin selection bit
 *
 */
typedef enum
{
    GPIO_P5D_P15 = 0x00u,
    GPIO_P5D_P36 = 0x40u,
    GPIO_P5D_P53 = 0x80u
} Gpio_P5dType;

/**
 * @brief P5C function pin selection bit
 *
 */
typedef enum
{
    GPIO_P5C_P14 = 0x00u,
    GPIO_P5C_P22 = 0x10u,
    GPIO_P5C_P23 = 0x20u
} Gpio_P5cType;

/**
 * @brief P5B function pin selection bit
 *
 */
typedef enum
{
    GPIO_P5B_P13 = 0x00u,
    GPIO_P5B_P21 = 0x04u,
    GPIO_P5B_P25 = 0x08u
} Gpio_P5bType;

/**
 * @brief P5A function pin selection bit
 *
 */
typedef enum
{
    GPIO_P5A_P12 = 0x00u,
    GPIO_P5A_P20 = 0x01u,
    GPIO_P5A_P30 = 0x02u
} Gpio_P5aType;

/**
 * @brief PWM33 function pin selection bit
 *
 */
typedef enum
{
    GPIO_PWM33_P12 = 0u,
    GPIO_PWM33_P40 = 1u
} Gpio_Pwm33Type;

/**
 * @brief PWM32 function pin selection bit
 *
 */
typedef enum
{
    GPIO_PWM32_P42 = 0u,
    GPIO_PWM32_P44 = 1u
} Gpio_Pwm32Type;

/**
 * @brief PWM31 function pin selection bit
 *
 */
typedef enum
{
    GPIO_PWM31_P43 = 0u,
    GPIO_PWM31_P50 = 1u
} Gpio_Pwm31Type;

/**
 * @brief PWM22 function pin selection bit
 *
 */
typedef enum
{
    GPIO_PWM22_P34 = 0u,
    GPIO_PWM22_P57 = 1u
} Gpio_Pwm22Type;

/**
 * @brief PWM21 function pin selection bit
 *
 */
typedef enum
{
    GPIO_PWM21_P31 = 0u,
    GPIO_PWM21_P32 = 1u
} Gpio_Pwm21Type;

/**
 * @brief PWM20 function pin selection bit
 *
 */
typedef enum
{
    GPIO_PWM20_P00 = 0x00u,
    GPIO_PWM20_P11 = 0x01u,
    GPIO_PWM20_P37 = 0x02u
} Gpio_Pwm20Type;

/**
 * @brief U1TC function pin selection bit
 *
 */
typedef enum
{
    GPIO_U1TC_P00 = 0x00u,
    GPIO_U1TC_P06 = 0x10u,
    GPIO_U1TC_P10 = 0x20u,
    GPIO_U1TC_P16 = 0x30u,
    GPIO_U1TC_P21 = 0x40u,
    GPIO_U1TC_P47 = 0x50u
} Gpio_U1tcType;

/**
 * @brief U1RD function pin selection bit
 *
 */
typedef enum
{
    GPIO_U1RD_P01 = 0x00u,
    GPIO_U1RD_P14 = 0x01u,
    GPIO_U1RD_P20 = 0x02u,
    GPIO_U1RD_P57 = 0x03u
} Gpio_U1rdType;

/**
 * @brief U2TC function pin selection bit
 *
 */
typedef enum
{
    GPIO_U2TC_P03 = 0x00u,
    GPIO_U2TC_P35 = 0x04u,
    GPIO_U2TC_P37 = 0x08u,
    GPIO_U2TC_P44 = 0x0Cu
} Gpio_U2tcType;

/**
 * @brief U2RD function pin selection bit
 *
 */
typedef enum
{
    GPIO_U2RD_P04 = 0x00u,
    GPIO_U2RD_P34 = 0x01u,
    GPIO_U2RD_P40 = 0x02u,
    GPIO_U2RD_P43 = 0x03u
} Gpio_U2rdType;

/**
 * @brief SDO function pin selection bit
 *
 */
typedef enum
{
    GPIO_SDO_P17 = 0x00u,
    GPIO_SDO_P20 = 0x10u,
    GPIO_SDO_P33 = 0x20u,
    GPIO_SDO_P35 = 0x30u,
    GPIO_SDO_P37 = 0x40u,
    GPIO_SDO_P45 = 0x50u
} Gpio_SdoType;

/**
 * @brief SCK function pin selection bit
 *
 */
typedef enum
{
    GPIO_SCK_SCL_P00 = 0x00u,
    GPIO_SCK_SCL_P10 = 0x01u,
    GPIO_SCK_SCL_P15 = 0x02u,
    GPIO_SCK_SCL_P21 = 0x03u,
    GPIO_SCK_SCL_P32 = 0x04u,
    GPIO_SCK_SCL_P40 = 0x05u,
    GPIO_SCK_SCL_P42 = 0x06u,
} Gpio_SckSclType;

/**
 * @brief SS function pin selection bit
 *
 */
typedef enum
{
    GPIO_SS_P05 = 0x00u,
    GPIO_SS_P23 = 0x01u
} Gpio_SsType;

/**
 * @brief SDI function pin selection bit
 *
 */
typedef enum
{
    GPIO_SDI_SDA_P01 = 0x00u,
    GPIO_SDI_SDA_P11 = 0x01u,
    GPIO_SDI_SDA_P13 = 0x02u,
    GPIO_SDI_SDA_P14 = 0x03u,
    GPIO_SDI_SDA_P22 = 0x04u,
    GPIO_SDI_SDA_P23 = 0x05u,
    GPIO_SDI_SDA_P34 = 0x06u,
    GPIO_SDI_SDA_P37 = 0x07u,
    GPIO_SDI_SDA_P40 = 0x08u,
    GPIO_SDI_SDA_P46 = 0x09u,
} Gpio_SdiSdaType;

/**
 * @brief BUZ3 function pin selection bit
 *
 */
typedef enum
{
    GPIO_BUZ3_P42 = 0u,
    GPIO_BUZ3_P44 = 1u
} Gpio_Buz3Type;

/**
 * @brief T1CK function pin selection bit
 *
 */
typedef enum
{
    GPIO_T1CK_P04 = 0x00u,
    GPIO_T1CK_P05 = 0x10u,
    GPIO_T1CK_P11 = 0x20u,
    GPIO_T1CK_P36 = 0x30u,
    GPIO_T1CK_P42 = 0x40u
} Gpio_T1ckType;

/**
 * @brief T1G function pin selection bit
 *
 */
typedef enum
{
    GPIO_T1G_P04 = 0x00u,
    GPIO_T1G_P05 = 0x04u,
    GPIO_T1G_P45 = 0x08u
} Gpio_T1gType;

/**
 * @brief T0CK function pin selection bit
 *
 */
typedef enum
{
    GPIO_T0CK_P03 = 0x00u,
    GPIO_T0CK_P06 = 0x01u,
    GPIO_T0CK_P33 = 0x02u,
    GPIO_T0CK_P42 = 0x03u
} Gpio_T0ckType;

/**
 * @brief INT1 function pin selection bit
 *
 */
typedef enum
{
    GPIO_INT1_P10 = 0x00u,
    GPIO_INT1_P11 = 0x10u,
    GPIO_INT1_P12 = 0x20u,
    GPIO_INT1_P25 = 0x30u,
    GPIO_INT1_P33 = 0x40u,
    GPIO_INT1_P36 = 0x50u,
    GPIO_INT1_P57 = 0x60u
} Gpio_Int1Type;

/**
 * @brief INT2 function pin selection bit
 *
 */
typedef enum
{
    GPIO_INT2_P13 = 0x00u,
    GPIO_INT2_P22 = 0x04u,
    GPIO_INT2_P24 = 0x08u,
    GPIO_INT2_P41 = 0x0Cu
} Gpio_Int2Type;

/**
 * @brief INT0 function pin selection bit
 *
 */
typedef enum
{
    GPIO_INT0_P03 = 0x00u,
    GPIO_INT0_P06 = 0x01u,
    GPIO_INT0_P33 = 0x02u,
    GPIO_INT0_P45 = 0x03u
} Gpio_Int0Type;

/**
 * @brief CCP5 function pin selection bit
 *
 */
typedef enum
{
    GPIO_CCP5_P12 = 0x00u,
    GPIO_CCP5_P20 = 0x01u,
    GPIO_CCP5_P23 = 0x02u,
    GPIO_CCP5_P35 = 0x03u,
    GPIO_CCP5_P11 = 0x04u,
    GPIO_CCP5_P57 = 0x05u,
    GPIO_CCP5_P44 = 0x06u,
    GPIO_CCP5_P50 = 0x07u
} Gpio_Ccp5Type;
/******************************************************************************
 *                      Export Variables
 *****************************************************************************/

/******************************************************************************
 *                      Export Functions
 *****************************************************************************/
/**
 * @brief P0 Port Direction Control
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 0 = The corresponding pin is configured as output
 * 1 = The corresponding pin is configured as input
 */
void Gpio_P0_DirCfg(Gpio_PinMaskType GpioPin, Gpio_PinDirType State);

/**
 * @brief P0 Digital Port Configuration
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 0 = Configure the corresponding pin as a digital port or special function pin
 * 1 = Configure the corresponding pin as an analog port
 */
void Gpio_P0_AnsCfg(Gpio_PinMaskType GpioPin, Gpio_PinAnsType State);

/**
 * @brief P0 Port Output Latch Settings
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 0 = Configure the corresponding pin as low level
 * 1 = Configure the corresponding pin as high level
 */
void Gpio_P0_OutLat(Gpio_PinMaskType GpioPin, Gpio_PinLevType State);

/**
 * @brief P0 Pull-up Function Enable
 * The pull-up resistor function can only be enabled when the pin is set as a digital input.
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 1 = Enable the corresponding port pull-up function
 * 0 = Prohibit the corresponding port pull-up function
 */
void Gpio_P0_PurEn(Gpio_PinMaskType GpioPin, Gpio_PinPurType State);

/**
 * @brief P0 Port Level Fluctuation Interrupt Enable
 * 1. The level change interrupt function can be enabled only when a pin is set as a digital input, and the level change
 * interrupt function will be disabled automatically when a pin is set as an output or analog input. If a pin is set as
 * output or analog input, the level change interrupt function of the pin will be disabled automatically.
 * 2. The level change interrupt of each pin of P0 port shares one interrupt enable bit and one interrupt response flag
 * bit.
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 1 = Enable the level fluctuation interrupt of the corresponding pin
 * 0 = Disable the level fluctuation interrupt of the corresponding pin
 */
void Gpio_P0_IocEn(Gpio_PinMaskType GpioPin, Gpio_PinIocType State);

/**
 * @brief P1 Port Direction Control
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 0 = The corresponding pin is configured as output
 * 1 = The corresponding pin is configured as input
 */
void Gpio_P1_DirCfg(Gpio_PinMaskType GpioPin, Gpio_PinDirType State);

/**
 * @brief P1 Digital Port Configuration
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 0 = Configure the corresponding pin as a digital port or special function pin
 * 1 = Configure the corresponding pin as an analog port
 */
void Gpio_P1_AnsCfg(Gpio_PinMaskType GpioPin, Gpio_PinAnsType State);

/**
 * @brief P1 Port Output Latch Settings
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 0 = Configure the corresponding pin as low level
 * 1 = Configure the corresponding pin as high level
 */
void Gpio_P1_OutLat(Gpio_PinMaskType GpioPin, Gpio_PinLevType State);

/**
 * @brief P1 Pull-up Function Enable
 * The pull-up resistor function can only be enabled when the pin is set as a digital input.
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 1 = Enable the corresponding port pull-up function
 * 0 = Prohibit the corresponding port pull-up function
 */
void Gpio_P1_PurEn(Gpio_PinMaskType GpioPin, Gpio_PinPurType State);

/**
 * @brief P2 Port Direction Control
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 0 = The corresponding pin is configured as output
 * 1 = The corresponding pin is configured as input
 */
void Gpio_P2_DirCfg(Gpio_PinMaskType GpioPin, Gpio_PinDirType State);

/**
 * @brief P2 Digital Port Configuration
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 0 = Configure the corresponding pin as a digital port or special function pin
 * 1 = Configure the corresponding pin as an analog port
 */
void Gpio_P2_AnsCfg(Gpio_PinMaskType GpioPin, Gpio_PinAnsType State);

/**
 * @brief P2 Port Output Latch Settings
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 0 = Configure the corresponding pin as low level
 * 1 = Configure the corresponding pin as high level
 */
void Gpio_P2_OutLat(Gpio_PinMaskType GpioPin, Gpio_PinLevType State);

/**
 * @brief P2 Pull-up Function Enable
 * The pull-up resistor function can only be enabled when the pin is set as a digital input.
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 1 = Enable the corresponding port pull-up function
 * 0 = Prohibit the corresponding port pull-up function
 */
void Gpio_P2_PurEn(Gpio_PinMaskType GpioPin, Gpio_PinPurType State);

/**
 * @brief P3 Port Direction Control
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 0 = The corresponding pin is configured as output
 * 1 = The corresponding pin is configured as input
 */
void Gpio_P3_DirCfg(Gpio_PinMaskType GpioPin, Gpio_PinDirType State);

/**
 * @brief P3 Digital Port Configuration
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 0 = Configure the corresponding pin as a digital port or special function pin
 * 1 = Configure the corresponding pin as an analog port
 */
void Gpio_P3_AnsCfg(Gpio_PinMaskType GpioPin, Gpio_PinAnsType State);

/**
 * @brief P3 Port Output Latch Settings
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 0 = Configure the corresponding pin as low level
 * 1 = Configure the corresponding pin as high level
 */
void Gpio_P3_OutLat(Gpio_PinMaskType GpioPin, Gpio_PinLevType State);

/**
 * @brief P3 Pull-up Function Enable
 * The pull-up resistor function can only be enabled when the pin is set as a digital input.
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 1 = Enable the corresponding port pull-up function
 * 0 = Prohibit the corresponding port pull-up function
 */
void Gpio_P3_PurEn(Gpio_PinMaskType GpioPin, Gpio_PinPurType State);

/**
 * @brief P4 Port Direction Control
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 0 = The corresponding pin is configured as output
 * 1 = The corresponding pin is configured as input
 */
void Gpio_P4_DirCfg(Gpio_PinMaskType GpioPin, Gpio_PinDirType State);

/**
 * @brief P4 Digital Port Configuration
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 0 = Configure the corresponding pin as a digital port or special function pin
 * 1 = Configure the corresponding pin as an analog port
 */
void Gpio_P4_AnsCfg(Gpio_PinMaskType GpioPin, Gpio_PinAnsType State);

/**
 * @brief P4 Port Output Latch Settings
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 0 = Configure the corresponding pin as low level
 * 1 = Configure the corresponding pin as high level
 */
void Gpio_P4_OutLat(Gpio_PinMaskType GpioPin, Gpio_PinLevType State);

/**
 * @brief P4 Pull-up Function Enable
 * The pull-up resistor function can only be enabled when the pin is set as a digital input.
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 1 = Enable the corresponding port pull-up function
 * 0 = Prohibit the corresponding port pull-up function
 */
void Gpio_P4_PurEn(Gpio_PinMaskType GpioPin, Gpio_PinPurType State);

/**
 * @brief P4 Port Level Fluctuation Interrupt Enable
 * 1. The level change interrupt function can be enabled only when a pin is set as a digital input, and the level change
 * interrupt function will be disabled automatically when a pin is set as an output or analog input. If a pin is set as
 * output or analog input, the level change interrupt function of the pin will be disabled automatically.
 * 2. The level change interrupt of each pin of P0 port shares one interrupt enable bit and one interrupt response flag
 * bit.
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 1 = Enable the level fluctuation interrupt of the corresponding pin
 * 0 = Disable the level fluctuation interrupt of the corresponding pin
 */
void Gpio_P4_IocEn(Gpio_PinMaskType GpioPin, Gpio_PinIocType State);

/**
 * @brief P5 Port Direction Control
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 0 = The corresponding pin is configured as output
 * 1 = The corresponding pin is configured as input
 */
void Gpio_P5_DirCfg(Gpio_PinMaskType GpioPin, Gpio_PinDirType State);

/**
 * @brief P5 Digital Port Configuration
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 0 = Configure the corresponding pin as a digital port or special function pin
 * 1 = Configure the corresponding pin as an analog port
 */
void Gpio_P5_AnsCfg(Gpio_PinMaskType GpioPin, Gpio_PinAnsType State);

/**
 * @brief P5 Port Output Latch Settings
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 0 = Configure the corresponding pin as low level
 * 1 = Configure the corresponding pin as high level
 */
void Gpio_P5_OutLat(Gpio_PinMaskType GpioPin, Gpio_PinLevType State);

/**
 * @brief P5 Pull-up Function Enable
 * The pull-up resistor function can only be enabled when the pin is set as a digital input.
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @param State Pin status
 * 1 = Enable the corresponding port pull-up function
 * 0 = Prohibit the corresponding port pull-up function
 */
void Gpio_P5_PurEn(Gpio_PinMaskType GpioPin, Gpio_PinPurType State);

/**
 * @brief Get gpio status
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @return Gpio_Status Io port level status
 */
Gpio_Status Gpio_Get_P0_Status(Gpio_PinMaskType GpioPin);

/**
 * @brief Get gpio status
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @return Gpio_Status Io port level status
 */
Gpio_Status Gpio_Get_P1_Status(Gpio_PinMaskType GpioPin);

/**
 * @brief Get gpio status
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @return Gpio_Status Io port level status
 */
Gpio_Status Gpio_Get_P2_Status(Gpio_PinMaskType GpioPin);

/**
 * @brief Get gpio status
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @return Gpio_Status Io port level status
 */
Gpio_Status Gpio_Get_P3_Status(Gpio_PinMaskType GpioPin);

/**
 * @brief Get gpio status
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @return Gpio_Status Io port level status
 */
Gpio_Status Gpio_Get_P4_Status(Gpio_PinMaskType GpioPin);

/**
 * @brief Get gpio status
 *
 * @param GpioPin Pin mask, supports multi-pin inputs, like this: GPIO_PIN_MASK_1 | GPIO_PIN_MASK_5 or GPIO_PIN_MASK_ALL
 * @return Gpio_Status Io port level status
 */
Gpio_Status Gpio_Get_P5_Status(Gpio_PinMaskType GpioPin);

/**
 * @brief Vref input pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_Vref_Select(Gpio_VrefType GpioPin);

/**
 * @brief P18 Outpin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_P18oe_Select(Gpio_P18oeType GpioPin);

/**
 * @brief Clk Outpin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_ClkOut_Select(Gpio_ClkOutType GpioPin);

/**
 * @brief Ccp3 function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_Ccp3_Select(Gpio_Ccp3Type GpioPin);

/**
 * @brief Ccp4 function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_Ccp4_Select(Gpio_Ccp4Type GpioPin);

/**
 * @brief P5D function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_P5d_Select(Gpio_P5dType GpioPin);

/**
 * @brief P5C function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_P5c_Select(Gpio_P5cType GpioPin);

/**
 * @brief P5B function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_P5b_Select(Gpio_P5bType GpioPin);

/**
 * @brief P5A function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_P5a_Select(Gpio_P5aType GpioPin);

/**
 * @brief PWM33 function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_Pwm33_Select(Gpio_Pwm33Type GpioPin);

/**
 * @brief PWM32 function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_Pwm32_Select(Gpio_Pwm32Type GpioPin);

/**
 * @brief PWM31 function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_Pwm31_Select(Gpio_Pwm31Type GpioPin);

/**
 * @brief PWM22 function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_Pwm22_Select(Gpio_Pwm22Type GpioPin);

/**
 * @brief PWM21 function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_Pwm21_Select(Gpio_Pwm21Type GpioPin);

/**
 * @brief PWM20 function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_Pwm20_Select(Gpio_Pwm20Type GpioPin);

/**
 * @brief U1TC function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_U1tc_Select(Gpio_U1tcType GpioPin);

/**
 * @brief U1RD function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_U1rd_Select(Gpio_U1rdType GpioPin);

/**
 * @brief U2TC function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_U2tc_Select(Gpio_U2tcType GpioPin);

/**
 * @brief U2RD function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_U2rd_Select(Gpio_U2rdType GpioPin);

/**
 * @brief SDO function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_Sdo_Select(Gpio_SdoType GpioPin);

/**
 * @brief SCK function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_Sck_Scl_Select(Gpio_SckSclType GpioPin);

/**
 * @brief SS function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_Ss_Select(Gpio_SsType GpioPin);
/**
 * @brief SDI/SDA function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_Sdi_Sda_Select(Gpio_SdiSdaType GpioPin);

/**
 * @brief BUZ3 function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_Buz3_Select(Gpio_Buz3Type GpioPin);

/**
 * @brief T1CK function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_T1ck_Select(Gpio_T1ckType GpioPin);

/**
 * @brief T1G function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_T1G_Select(Gpio_T1gType GpioPin);

/**
 * @brief T0CK function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_T0ck_Select(Gpio_T0ckType GpioPin);

/**
 * @brief INT1 function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_Int1_Select(Gpio_Int1Type GpioPin);

/**
 * @brief INT2 function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_Int2_Select(Gpio_Int2Type GpioPin);

/**
 * @brief INT0 function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_Int0_Select(Gpio_Int0Type GpioPin);

/**
 * @brief CCP5 function pin selection bit
 *
 * @param GpioPin Pin select
 */
void Gpio_Ccp5_Select(Gpio_Ccp5Type GpioPin);

/**
 * @brief Ports pull-up total enable bit
 *
 * @param GpioPin Pin select
 */
void Gpio_Puph_Enable(Gpio_PinPuphType State);

/**
 * @brief P0 Deinitialization
 *
 */
void Gpio_P0_DeInit(void);

/**
 * @brief P1 Deinitialization
 *
 */
void Gpio_P1_DeInit(void);

/**
 * @brief P2 Deinitialization
 *
 */
void Gpio_P2_DeInit(void);

/**
 * @brief P3 Deinitialization
 *
 */
void Gpio_P3_DeInit(void);

/**
 * @brief P4 Deinitialization
 *
 */
void Gpio_P4_DeInit(void);

/**
 * @brief P5 Deinitialization
 *
 */
void Gpio_P5_DeInit(void);
#ifdef __cplusplus
}
#endif

#endif
/* EOF */
